<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
<head>
<title></title>
<meta charset="utf-8">
<meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="copyright" content="http://www.appcms.org" />
<link rel="stylesheet" href="skin/base.css">
<link rel="stylesheet" href="skin/picture.css">
<script src="js/zy_control.js"></script>
<script src="js/zy_click.js"></script>
<script src="js/config.js"></script>
<script src="js/common.js"></script>
</head>
<body>
	
	
<div id="main">
</div>
</body>
<script>
	zy_init();
	
	var page=1;
	function getMain(t){
		if (t==-1){
			$$('main').className="loading";
		}
		if(t<1){
			page=1;
		}
		
		uexXmlHttpMgr.open(t,'post',app_api+'&a=lists&catid='+catid_cur('picture')+'&page='+page,"8000");
		uexXmlHttpMgr.send(t);
	}
	
	window.uexOnload=function(type){
		if (!type){
			uexWindow.setBounce("1");
			uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
	　　　　	uexWindow.setBounceParams("1",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"","pullToReloadText":"上拉加载更多","releaseToReloadText":"释放加载","loadingText":"加载中，请稍等"}');
	　　　　	uexWindow.showBounceView("0","#f3f3f3","1");
	　　　　	uexWindow.notifyBounceEvent("0","1");
			uexWindow.showBounceView("1","#f3f3f3","1");
　　　　		uexWindow.notifyBounceEvent("1","1");
			uexWindow.onBounceStateChange=function(t,s){
	　　　　　　	if(t=="0"||t=="1"){
	　　　　　　　　	if(s=="2"){
						getMain(t);
					}
	　　　　　　	}
	　　　　	}
	
			uexXmlHttpMgr.onData = function(opId, status, data){
				if(status==1){
					uexXmlHttpMgr.close(opId);
					uexWindow.resetBounceView(opId);
					data = JSON.parse(data);				
					if(opId<1){					
						$$('main').innerHTML='';
						uexWindow.setBounceParams("0",'{"imagePath":"res://loading.png","textColor":"#666","levelText":"上次更新：'+Now()+'","pullToReloadText":"拖动刷新","releaseToReloadText":"释放刷新","loadingText":"加载中，请稍等"}');
					}
					var list=data['list'];
					if(list.length>0){
						page++;
						$$("main").className = '';
						for (i = 0; i < list.length; i++) {
							
							var div = document.createElement("div");
							div.className='lists';
							div.innerHTML = '<div class="loadimg"><img src="'+list[i]['thumb']+'" onclick="jump('+list[i]['id']+','+list[i]['catid']+');" class="hide" onload="this.className=\'\'"></div><span>'+list[i]['title']+'</span>';
							
							$$('main').appendChild(div);							
						}						
					}else{
						if(opId==-1||opId==0){
							$$("main").className = 'notdata';
						}
					}
				}else if(status ==-1) {
					uexXmlHttpMgr.close(opId);
					if(opId==-1){
						$$("main").className='errer';
					}else{
						uexWindow.resetBounceView(opId);
						uexWindow.toast("0","5",'加载失败',1000);
					}
				}
			}
		
			getMain(-1);
		}
	}
	
	function jump(id,catid){
		localStorage['picture_id']=id;
		localStorage['picture_catid']=catid;
		uexWindow.open('picture_show','0','picture_show.html','2','', '',0);
	}
	
	</script>
</html>